<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{$page['title']}</title>
<meta name="keywords" content="{$page['keywords']}" />
<meta name="description" content="{$page['description']|clearh}" />
<script src="__PUBLIC__/js/jquery-1.3.2.min.js"></script>
<script src="__PUBLIC__/js/jquery.simplemodal.js"></script>
<script src="__PUBLIC__/js/jquery.form.js"></script>
<link href="__PUBLIC__/default/css/global.css" rel="stylesheet" type="text/css" />
<link href="__PUBLIC__/default/css/group_content.css" rel="stylesheet" type="text/css" />
<style type="text/css">
	#simplemodal-overlay {background-color:#000; cursor:wait;}
	#simplemodal-container {height:320px; width:600px; color:#111; background-color:#eee; border:4px solid #444; padding:12px;}
	#simplemodal-container code {background:#141414; border-left:3px solid #65B43D; color:#bbb; display:block; margin-bottom:12px; padding:4px 6px 6px;}
	#simplemodal-container a {color:#ddd;}
	#simplemodal-container a.modalCloseImg {background:url(__PUBLIC__/default/images/x.png) no-repeat; width:25px; height:29px; display:inline; z-index:3200; position:absolute; top:-15px; right:-16px; cursor:pointer;}
	#simplemodal-container #basic-modal-content {padding:8px;}
</style>
<script type="text/javascript">
    var HOST = window.location.host;
    var Per_host = "http://" + HOST;
    var JS_PATH = "../Public/js/";
    var IMG_PATH = "../Public/images/";
    var URL = '__URL__';
    var APP = '__APP__';
    var PUBLIC = '../Public/';
    var REQUEST_URI = '{$_SERVER.REQUEST_URI}';
	$(document).ready(function () {
		var tourl=APP+'/Public/ajax_is_login';
		$('a.add_post').click(function (e) {
			e.preventDefault();
			$.post(tourl,'',function(data){
				if(data['status']==1){
					$('#basic-modal-content').modal();
				}else{
					alert(data['info']);
					$('#login').modal();
				}
			},'json');
		});
		$('a.join_group').click(function (e) {
			$.post(tourl,'',function(data){
				if(data['status']==1){
					join_group();
				}else{
					alert(data['info']);
					$('#login').modal();
				}
			},'json');
		});
		var option={dataType:'json',success:processJson};
		var option_login={dataType:'json',success:login};
	    $('#add_post').ajaxForm(option);
	    $('#post_login').ajaxForm(option_login);
		
	});
	function processJson(data){
		if(data['status']==1){
			alert(data['info']);
			
			var text='<dd><span class="w381"><a href="__APP__/grpTs/'+data['data']['id']+'.html">'+$("#title").val()+'</a></span>';
				text+='<span class="w100 c">'+data['data']['username']+'</span>';
				text+='<span class="w100 c">'+data['data']['lasttime']+'</span>';
				text+='<span class="w100 c">'+data['data']['dateline']+'</span></dd>';
			$("#post_ok").prepend(text);
			$("#post_ok").show();
			$.modal.close();
		}else{
			alert(data['data']);
			if(data['data']=="login"){
				$.modal.close();
				$('#login').modal();
			}else{
				alert(data['info']);
			}

		} 
	}
	function login(data){
		if(data['status']==1){
			alert(data['info']);
			$.modal.close();
			//$('#basic-modal-content').modal();
		}else{
			alert(data['info']);

		} 
	}

	function join_group(){
		var tourl=URL+'/join_group';
		var gid="{$info['id']}";
		$.post(tourl,{gid:gid},function(data){
			if(data['status']=='1'){
				alert(data['info']);
			}else if(data['data']=='login'){
				alert(data['info']);
				$('#login').modal();
			}else{
				alert(data['info']);
			}
		},'json');
	}
</script>
</head>
<body>
<include file="Public:top"/>

    <!--中间开始-->
    <div id="main">
        <div class="right">
            <div class="next_lssue">
                <div class="next-bg">
                    New Members
                </div>
                <div class="chengyuan">
<if condition="$newmember">
	<volist name="newmember" id="v">
                    <dl class="group-m">
                        <dt>
                            <img src="{$v['uid']|get_avatar}" alt="{$v['username']}" />
                        </dt>
                        <dd>
                            {$v['username']}
                        </dd>
                    </dl>
	</volist>
</if>
                    <div class="clear"></div>
                </div>
                <div class="conter-group" style="background-color:#f3f3f3;">
                	<div class="group"><a href="__APP__/group.html">Featured Groups</a></div>
<if condition="$member_group">
	<volist name="member_group" id="g">
                   <dl class="group-x">
                        <dt><a href="__APP__/grps/{$g['id']}/{$g['groupname']|str_to_url}.html"><img src="{$g['pic']|toImg=group}" alt="{$g['groupname']}" /></a></dt>
                        <dd>
                            <h5><a href="__APP__/grps/{$g['id']}/{$g['groupname']|str_to_url}.html" title="{$g['groupname']}">{$g['groupname']}</a></h5>
                            <p>Member:{$g['membernum']}<br/>Topic:{$g['threadnum']}</p>
                        </dd>
                    </dl>
	</volist>
</if>
                </div>
                
                <div class="guang">
					
                </div>
                <div class="main-group m10" style="text-align:center">
                	{$ad['right']}
					<script type="text/javascript"><!--
                    google_ad_client = "pub-0787067378614221";
                    /* 200x200, 创建于 10-8-27 event_group_all_r */
                    google_ad_slot = "2776601511";
                    google_ad_width = 200;
                    google_ad_height = 200;
                    //-->
                    </script>
                    <script type="text/javascript"
                    src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
                    </script>
                </div>
            </div>
        </div>
        <div class="n-life">
            <div class="classifieds_content">
                <div class="content-bg">
                    <a href="__APP__/index.html">Home</a> > <a href="__APP__/group.html">Groups</a> > 
					<if condition="$dh">
	                    <if condition="$dh[_pid]">
	                        <a href="__APP__/glist/{$dh[_pid]['id']}/{$dh[_pid]['title']|str_to_url}.html">{$dh[_pid]['title']}</a> >
	                    </if>
	                    <a href="__APP__/glist/{$dh['id']}/{$dh['title']|str_to_url}.html">{$dh['title']}</a> > 
	                </if>
                </div>
                <div class="content-n">
                	<h1>{$info['groupname']}</h1>
                    <div class="touxiang">
                        <span>
                        	<img src="{$info['pic']|toImg=group}" alt="{$info['groupname']}" />
						</span>
                        <ul>
                            <li>
                                Group Administrators:{$info['username']} Created On {$info['ctime']|toDate='m/d/Y'}
                            </li>
                            <li>
                               Total Members:{$info['membernum']} / Topics:{$info['threadnum']} / Replies:{$info['postnum']}
                            </li>
                            <li>
                                Latest Update:{$info['lasttime']|toDate}
                            </li>
                            <li>
                                Key Words:{$info['tags']}
                            </li>
							<li>
                                Brief Introduction:{$info['announcement']}
                            </li>
                        </ul>
                      	<div align="left">
<if condition="$ad['banner']['0']">
							{$ad['banner']['0']}
<else/>
                        	<script type="text/javascript"><!--
							google_ad_client = "pub-0787067378614221";
							/* 468x60, 创建于 10-8-27 group event */
							google_ad_slot = "2310586877";
							google_ad_width = 468;
							google_ad_height = 60;
							//-->
							</script>
							<script type="text/javascript"
							src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
							</script>
</if>
                        </div>
                        <div class="anjian">
                            <ul>
                                <li>
                                    <a href="#group_{$info['id']}" id="group_{$info['id']}" class="join_group">Join in</a>
                                </li>
                                <li>
                                    <a href="#" class="add_post">Post new topic</a>
                                </li>
                            </ul>
                        </div>
						<div class="clear"></div>
					<div class="grouptopics">
                            <span style="float:right; height:auto;"><a href="__URL__/topic/id/{$info['id']}">View all</a></span>Group topics
                        </div>
						<dl class="h350">
			            	<dt class="w381">Topic</dt>
							<dt class="w100">User name</dt>
							<dt class="w100">Latest reply</dt>
							<dt class="w100">Post time</dt>
							<div id="post_ok" style="display:none;"></div>

<if condition="$thread">
<volist name="thread" id="v">
		                	<dd>
								<span class="w381 l"><a href="__APP__/grpts/{$v['id']}/{$v['title']|str_to_url}.html">{$v['title']}</a></span>
								<span class="w100 c">{$v['username']}</span>
								<span class="w100 c">{$v['lasttime']|toDate='Y-m-d'}</span>
								<span class="w100 c">{$v['dateline']|toDate='Y-m-d'}</span>
							</dd>
		                    
</volist>
<else/>
<dd>
	<span class="w381">No topic now</span>
	<span class="w100 c"></span>
	<span class="w100 c"></span>
	<span class="w100 c"></span>
</dd>
</if>
		            </dl>
					
					<div class="clear"></div>
<if condition="$ad['banner']['1']">
					<div align="left">
					{$ad['banner']['1']}
                    </div>
                    <div class="clear"></div>
</if>
                        <div class="grouptopics">
                            <span style="float:right; height:auto;"><a href="__URL__/collection/id/{$info['id']}">View all</a></span>Group favorite
                        </div>
						<dl class="h350">
			            	<dt class="w381">Collection</dt>
							<dt class="w100">Shared by</dt>
							<dt class="w100">Channel</dt>
							<dt class="w100">Share time</dt>
<if condition="$collection">
<volist name="collection" id="v">
		                	<dd>
								<span class="w381 l">
									<a href="__APP__/{$v['types']|get_url='show'}/{$v['xid']}/subject/{$v['xid']|get_title||str_to_url}.html">{$v['xid']|get_title}</a>
								</span>
								<span class="w100 c">{$v['username']}</span>
								<span class="w100 c">{$v['types']|get_type}</span>
								<span class="w100 c">{$v['ctime']|toDate='Y-m-d'}</span>
							</dd>
		                    
</volist>
<else/>
<dd>
	<span class="w381">No group favorite now</span>
	<span class="w100 c"></span>
	<span class="w100 c"></span>
	<span class="w100 c"></span>
</dd>
</if>
		            </dl>
					
                    </div>
                </div>
            </div>
            <div class="clear"></div>
        </div>
    </div>
    <div class="clear"></div>
</div>
<div id="basic-modal-content" style="display:none;">
<form action="__URL__/add_post" method="post" id="add_post">
	<input type="hidden" name="gid" value="{$info['id']}" />
	<fieldset class="post">
		<legend>Post new topic</legend>
		<p>
			<label for="title">Title:</label>
			<input type="text" name="title" id="title" style="width:450px;" />
		</p>
		<p>
			<label for="message">Content:</label>
			<textarea name="message" id="message" cols="45" rows="8"></textarea>
		</p>
		<p style="text-align:right; padding-right:50px;">
			<input type="submit" value="Submit" />
		</p>
	</fieldset>
</form>
<span id="v_title"></span>
<span id="v_message"></span>
</div>
<div id="login" style="display:none;">
<form action="__APP__/Public/check" method="post" id="post_login">
	<input type="hidden" name="is_ajax" value="1" />
	<fieldset class="post">
		<legend>Login</legend>
		<p>
			<label for="username">User name:</label>
			<input type="text" name="username" id="username" style="width:200px;" />
		</p>
		<p>
			<label for="password">Password:</label>
			<input type="password" name="password" id="password" style="width:200px;"/>
		</p>
		<p style=" text-align:right; padding-right:50px;">
			<input type="submit" value="Submit" />
		</p>
	</fieldset>
</form>
</div>
<include file="Public:foot" />